#include "Student.h"

using namespace std;


Student::Student()
{
	firstName="";
	lastName="";
	enrollmentYear=0;
}


Student::Student(string fn, string ln,int ey)
{
	firstName=fn;
	lastName=ln;
	enrollmentYear=ey;
}

void Student::Read()
{
	cout << "Firstname: ";
	cin >> firstName;
	cout << "Lastname: ";
	cin >> lastName;
	cout << "Enrollment year: ";
	cin >> enrollmentYear;
}

void Student::Write()
{
	cout << "Firstname: " << firstName << endl;
	cout << "Lastname: " << lastName << endl;
	cout << "Enrollment year: " << enrollmentYear << endl;
}

ostream & operator << (ostream & o, const Student & Student)
{
	o << Student.firstName << setw(5) << Student.lastName << setw(5) << Student.enrollmentYear << setw(5) << endl;
	return o;
}

istream & operator >> (istream & in, Student & Student)
{
	cout << "Ange en ny elev: " << endl;
	in >> Student.firstName;
	in >> Student.lastName;
	in >> Student.enrollmentYear;
	
	
	return in;
}